MACRO(DEFSAMPLE NAME)
    SET(SAMPLE_NAME ${SAMPLE_PREFIX}${NAME})
    SET(${SAMPLE_NAME}_SRCS ${SAMPLE_COMMON_FILES} ${SAMPLE_NAME}.c)

    ADD_EXECUTABLE(${SAMPLE_NAME}-glibc ${${SAMPLE_NAME}_SRCS})
    SET_TARGET_PROPERTIES(${SAMPLE_NAME}-glibc PROPERTIES
        OUTPUT_NAME "${SAMPLE_NAME}"
        RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/glibc
        LINK_FLAGS "-ldl"
    )
    ADD_DEPENDENCIES(${SAMPLE_NAME}-glibc ${SAMPLE_DEPLIB}_static_glibc alog_static_glibc)
    TARGET_LINK_LIBRARIES(${SAMPLE_NAME}-glibc
        ${PROJECT_BINARY_DIR}/lib-glibc/lib${SAMPLE_DEPLIB}.a
        ${PROJECT_BINARY_DIR}/lib-glibc/libalog.a
        pthread m rt stdc++
    )

    ADD_EXECUTABLE(${SAMPLE_NAME}-uclibc ${${SAMPLE_NAME}_SRCS})
    SET_TARGET_PROPERTIES(${SAMPLE_NAME}-uclibc PROPERTIES
        OUTPUT_NAME "${SAMPLE_NAME}"
	RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/uclibc
	LINK_FLAGS "-muclibc -ldl"
	COMPILE_FLAGS "-muclibc -ldl"
    )
    ADD_DEPENDENCIES(${SAMPLE_NAME}-uclibc ${SAMPLE_DEPLIB}_static_uclibc alog_static_uclibc)
    TARGET_LINK_LIBRARIES(${SAMPLE_NAME}-uclibc
        ${PROJECT_BINARY_DIR}/lib-uclibc/lib${SAMPLE_DEPLIB}.a
        ${PROJECT_BINARY_DIR}/lib-uclibc/libalog.a
        pthread m rt stdc++
    )
ENDMACRO()

ADD_SUBDIRECTORY(libimp-samples)
ADD_SUBDIRECTORY(libsysutils-samples)
